package com.shutong.edu.invoke.retry.test;

import com.shutong.edu.invoke.retry.annotation.EnableRetry;

public class Greet2ServiceImpl {

    @EnableRetry(interval = 100, exp = "result == 'Hello, Jack'", val = "result", fallbackMethod = "fallback")
    public String greet(String name) {
        return "Hello, " + name;
        // throw new RuntimeException("Empty method.");
    }

    private String fallback(String name, Throwable throwable, Object result) {
        return "您好，中国！";
    }
}
